var box = document.getElementById('box');
var car = document.getElementById('car');


window.onload = function(){

	var car = document.createElement('img');
	car.id = 'car';
	box.appendChild(car);
	car.src = 'img/car1.png';
var timer = null;
var carOff = car.offsetLeft;
  timer = setInterval(function(){
	    carOff -= 20;
	    car.style.left = carOff + 'px';
	    if (carOff <= 0) {
		   clearInterval(timer);
		   timer = null;	   
		   window.open('didi2.html','_self');
	 }
  },100)

  }